<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin_model extends CI_Model {

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
    function get_details($dorm_name){
		return $this->db->query("SELECT * FROM dormitorydetails WHERE dorm_name='".$dorm_name."'");
	}
	
	function edit_details($_POST){
		$this->db->query("UPDATE dormitorydetails SET
			capacity='".$_POST["capacity"]."',
			dorm_for='".$_POST["dorm_for"]."',
			location=\"".$_POST["location"]."\",
			manager='".$_POST["manager"]."',
			position='".$_POST["position"]."',
			name1='".$_POST["name1"]."',
			position1='".$_POST["position1"]."',
			name2='".$_POST["name2"]."',
			position2='".$_POST["position2"]."'
			WHERE dorm_name='ACCI Dormitory'
			");
	}
}
/* End of file admin_model.php */
/* Location: ./application/models/admin_model.php */
?>